<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />	
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/addon/rights/css/core.css" />	
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/addon/rights/css/defaulth.css" />	
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/addon/rights/js/rights.js"></script>
<style>
	.page-content {
    float: left;
	width: 100%;
}
</style>
<div id="operations">
<div class="single-head">
	<h3 class="pull-left"><i class="fa fa-desktop purple"></i> <?php echo Rights::t('core', 'Generate items'); ?></h3>
	<div class="breads pull-right">
		<strong>Nav</strong> : <a href="<?php echo Yii::app()->createUrl('User'); ?>">Home</a>  / Rigths / <?php echo Rights::t('core', 'Generate items'); ?>
	</div>
	<div class="clearfix"></div>
</div>
<div id="rights" class="container">
<div id="generator">
	<?php 
		$this->beginWidget('zii.widgets.CPortlet', array(
			'htmlOptions'=>array(
				'class'=>''
			)
		));
		$this->widget('bootstrap.widgets.TbMenu', array(
			'type'=>'pills',
			'items'=>array(
				array('label'=>'Assignments', 'url'=>Yii::app()->controller->createUrl('assignment/view'), 'linkOptions'=>array()),
				array('label'=>'Permissions', 'url'=>Yii::app()->controller->createUrl('authItem/permissions'), 'linkOptions'=>array()),
				array('label'=>'Roles', 'url'=>Yii::app()->controller->createUrl('authItem/roles'),  'linkOptions'=>array()),
				array('label'=>'Tasks', 'url'=>Yii::app()->controller->createUrl('authItem/tasks'), 'active'=>true,'linkOptions'=>array()),
				array('label'=>'Operations', 'url'=>Yii::app()->controller->createUrl('authItem/operations'), 'linkOptions'=>array()),
			),
		));
		$this->endWidget();
	?>

	<p><?php echo Rights::t('core', 'Please select which items you wish to generate.'); ?></p>

	<div class="form">

		<?php $form=$this->beginWidget('CActiveForm'); ?>

			<div class="row">

				<table class="items generate-item-table" border="0" cellpadding="0" cellspacing="0">

					<tbody>

						<tr class="application-heading-row">
							<th colspan="3"><?php echo Rights::t('core', 'Application'); ?></th>
						</tr>

						<?php $this->renderPartial('_generateItems', array(
							'model'=>$model,
							'form'=>$form,
							'items'=>$items,
							'existingItems'=>$existingItems,
							'displayModuleHeadingRow'=>true,
							'basePathLength'=>strlen(Yii::app()->basePath),
						)); ?>

					</tbody>

				</table>

			</div>

			<div class="row">

   				<?php echo CHtml::link(Rights::t('core', 'Select all'), '#', array(
   					'onclick'=>"jQuery('.generate-item-table').find(':checkbox').attr('checked', 'checked'); return false;",
   					'class'=>'selectAllLink')); ?>
   				/
				<?php echo CHtml::link(Rights::t('core', 'Select none'), '#', array(
					'onclick'=>"jQuery('.generate-item-table').find(':checkbox').removeAttr('checked'); return false;",
					'class'=>'selectNoneLink')); ?>

			</div>

   			<div class="row">

				<?php //echo CHtml::submitButton(Rights::t('core', 'Generate')); ?>
				<?php $this->widget('bootstrap.widgets.TbButton', array(
					'buttonType'=>'submit',
					'type'=>'primary',
					'icon'=>'ok white',  
					'label'=>'Generate',
				)); ?>

			</div>

		<?php $this->endWidget(); ?>

	</div>

</div>
</div>